let today = new Date();
let day = today.getDate();
let month = today.getMonth()+1;
let day_index = today.getDay();
let weeks = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
let week = weeks[day_index];

document.getElementsByClassName("myday")[0].innerHTML = month + "月" + day + "日  " + week



$('#student_profile').click(function(){

    let student_has_logined = document.getElementById("application-scope").innerHTML
    if(student_has_logined != "1"){
        window.location.href = "login.jsp"
    }else{
        window.location.href = "profile-stu.jsp"
    }

})


let signin_has_released = document.getElementById("application-scope3").innerHTML
if(signin_has_released != "1"){
    //老师今天还没有发布签到呢
    document.getElementById("today_has_no_signin").style.display = "block"
    document.getElementById("today-has-signined").style.display = "none"
    document.getElementById("today-has-not-signined").style.display = "none"
}else{
    let student_has_clockin = document.getElementById("application-scope2").innerHTML
    if(student_has_clockin == "1"){
        document.getElementById("today_has_no_signin").style.display = "none"
        document.getElementById("today-has-signined").style.display = "block"
        document.getElementById("today-has-not-signined").style.display = "none"
    }else{
        document.getElementById("today_has_no_signin").style.display = "none"
        document.getElementById("today-has-signined").style.display = "none"
        document.getElementById("today-has-not-signined").style.display = "block"
    }
}






$('#student_go_clockin').click(function(){
    let student_has_logined = document.getElementById("application-scope").innerHTML
    if(student_has_logined == "1"){
        window.location.href = "signin.jsp"
    }else{
        window.location.href = "login.jsp"
    }

})